/*******************************************************************************
 * Copyright (c) 2005, 2014 springside.github.io
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package cn.ilongfei.service.account;

import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springside.modules.security.utils.Digests;
import org.springside.modules.utils.Clock;
import org.springside.modules.utils.Encodes;

import cn.ilongfei.entity.Role;
import cn.ilongfei.entity.User;
import cn.ilongfei.repository.RoleDao;
import cn.ilongfei.repository.TaskDao;
import cn.ilongfei.repository.UserDao;
import cn.ilongfei.service.ServiceException;
import cn.ilongfei.service.account.ShiroDbRealm.ShiroUser;

/**
 * 用户管理类.
 * 
 * @author calvin
 */
// Spring Service Bean的标识.
@Component
@Transactional
public class RoleService {

	private static Logger logger = LoggerFactory.getLogger(RoleService.class);

	private RoleDao roleDao;

	public List<Role> getAllRoles() {
		return (List<Role>) roleDao.findAll();
	}

	@Autowired
	public void setRoleDao(RoleDao roleDao) {
		this.roleDao = roleDao;
	}

}
